#include<stdio.h>
int main()
{
	const int maxNumber = 50;
	//int prime[maxNumber];
	int prime[50];
	for (int i = 0; i < maxNumber; i++)
	{
		prime[i] = 1;
	}
	for (int x=2;x<maxNumber;x++)
	{
		if (prime[x])
		{
			for (int i = 2; i * x < maxNumber; i++)
			{
				prime[i * x] = 0;
			}
		}
	}
	for (int i = 2; i < maxNumber; i++)
	{
		if (prime[i])
		{
			printf("%d\t", i);
		}
	}
	printf("\n");
	return 0;
}